<template>
    <div>
      <titleTop :titleTxet="titleTxet"></titleTop>
      <div class="s_con">
        <input type="text" v-model="Val" autofocus="autofocus">
        <p class="s_p">一个好的名字更容易，引起关注。</p>
      </div>
      <div class="button" @click="finis2()">保存</div>
    </div>
</template>

<script>
  import {Dialog} from 'vant';
  import titleTop from "../../com/title";
  import * as common from "../../../api/common.js";
    export default {
      name: "SetName",
      components: { titleTop },
      data(){
        return {
          Val:this.$route.query.cont,
          titleTxet: {
            titleName: "更改昵称",
            IsBool: true,
            IsShare: false
          },
        }
      },
      methods:{
        finis2(){
          let parms5 = {
            user_id:this.$store.state.user_id,
            user_login:this.Val
          };
          common.change_userinfo(parms5).then(res=>{
            console.log(res);
            if (res.status==200) {
              Dialog.alert({
                message: res.msg
              });
              history.go(-1);
            }
          })
        }
      }
    }
</script>

<style scoped>
.s_con{
  padding: 20px 40px;
}
  .s_con input{
    caret-color: #884ca4;
    border: 2px solid #dcdcdc;
    width: 100%;
    height: 80px;
    padding-left: 20px;
    box-sizing: border-box;
    font-size: 32px;
  }
  .s_con .s_p{
    padding-top: 20px;
    font-size: 24px;
    color: #999797;
  }
  .button{
    width: 200px;
    height: 80px;
    margin: 80px auto 0;
    background: #884ca4;
    color: #fff;
    font-size: 32px;
    line-height: 80px;
    text-align: center;
    border-radius: 10px;
  }
</style>
